/**
 * @Title: auditLeft.js
 * @Description: TODO
 * Copyright: Copyright (c) 2014 
 * Company:中国平安
 *
 * @Project HIMS-FWA
 * @author ex-xieqi001
 * @date 2014年11月17日 下午05:48:10
 * @version V1.0
 */
;
(function(){
	'use strict';
	
	var app = angular.module('fwa.directives');
	app.directive('fwaAuditLeft', ['BaseURL',function(baseUrl){
		
		function ctrler($scope, $element, $attrs, $transclude) {
			
			$scope.type =  $attrs.type || false;
			
			$scope.object = $attrs.object || {};
			
			//监听显示不同类型变化
			$scope.$parent.$watchCollection($attrs.type,function(v){
				$scope.type = v;
			});
			
			//监听数据变化
			$scope.$parent.$watchCollection($attrs.object,function(v){
				if (v) {
					$scope.object = v;
				}
			});
			
			//关联案件
			$scope.showModal = function() {
				$scope.$emit('fwaAuditLeft.showModal');
			}
			
		}
		
		return {
			restrict: 'E',
			scope:true,
			replace:true,
			templateUrl:baseUrl + 'views/hcpms/common/directives/auditLeft.html',
			controller:ctrler
		};
		
	}]);
	
})();